<template>
	<vue-modal
    :title="title"
    ok-text="提交"
    cancel-text="取消"
    :show.sync="showMiniPrizeModal"
    effect="fade"
    :small="true"
    :width="460"
    :callback="submit">
    <div slot="modal-body" class="modal-body">
      <form class="form-horizontal" role="form">
        <div class="form-group form-group-sm text-left">
          <label class="col-sm-3 control-label">*名称</label>
          <div class="col-sm-9">
            <div class="text-left">
              <input type="text" class="form-control" v-model="prize.name">
            </div>
          </div>
        </div>
        <div class="form-group form-group-sm text-left">
          <label class="col-sm-3 control-label">*图片文件</label>
          <div class="col-sm-9 ">
            <div class="text-left">
              <div class="pic-url" v-if="title === '修改奖品'">
                原广告图：<br>
                <img :src="prize.picUrl" class="update-pic">
              </div>
              <input type="file" class="form-control" accept="image/jpeg,image/png" v-model="prize.pic" v-el:file>
            </div>
          </div>
        </div>
        <div class="form-group form-group-sm text-left">
          <label class="col-sm-3 control-label">*总数</label>
          <div class="col-sm-9">
            <div class="text-left">
              <input type="number" class="form-control" v-model="prize.totalNum">
            </div>
          </div>
        </div>
        <div class="form-group form-group-sm text-left">
          <label class="col-sm-3 control-label">*中奖几率</label>
          <div class="col-sm-9">
            <div class="text-left">
              <input type="number" class="form-control" v-model="prize.rate" min="0" max="1" step="0.1" placeholder="0-1之间的小数">
            </div>
          </div>
        </div>
        <div class="form-group form-group-sm text-left">
          <label class="col-sm-3 control-label">种子数/价值</label>
          <div class="col-sm-9">
            <div class="text-left">
              <input type="number" class="form-control" v-model="prize.seedNum" min="0" step="1">
            </div>
          </div>
        </div>
        <div class="form-group form-group-sm text-left">
          <label class="col-sm-3 control-label">类型</label>
          <div class="col-sm-9">
            <div class="text-left">
              <select class="form-control" v-model="prize.type">
                <option value="0">实物奖品</option>
                <option value="1">虚拟奖品</option>
                <option value="2">需兑换码奖品</option>
                <option value="3">贝塔豆</option>
                <option value="4">课程</option>
              </select>
            </div>
          </div>
        </div>
        <div class="form-group form-group-sm text-left" v-if="title === '修改奖品'">
          <label class="col-sm-3 control-label">奖品状态</label>
          <div class="col-sm-9">
            <div class="text-left">
              <select class="form-control" v-model="prize.status">
                <option value="0">失效</option>
                <option value="1">有效</option>
              </select>
            </div>
          </div>
        </div>
      </form>
    </div>
  </vue-modal>
</template>
<style src="./mini-prize-config.css" scoped></style>
<script src="./mini-prize-config.js"></script>
